<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="/admin/include/css/table.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/admin/manage/module/moduleJs.js"></script>
	</head>

	<body>
		<form>
			<input type="hidden" name="moduleId" value="${param.moduleId}" />
			<table id="listtable" cellspacing="0">
				<tr>
					<td class="toolbar" colspan="5">
						<input type="button" value="添加功能" class="add_button"
							onclick="window.location.href='/admin/manage/module/functionAdd.seam?moduleId=${param.moduleId}'" />
						<input type="button" value="编辑功能" class="edit_button"
							onclick="editFunction()" />
						<input type="button" value="删除功能" class="delete_button"
							onclick="deleteFunction()" />
					</td>
				</tr>
				<tr>
					<th width="2%">
						<input type="checkbox" name="checkAll" onclick="checkedAll(this)" />
					</th>
					<th width="3%">
						#
					</th>
					<th width="30%">
						功能名称
					</th>
					<th width="50%">
						功能描述
					</th>
					<th width="15%">
						排序
					</th>
				</tr>
				<c:forEach items="${pageResult.resultList}" var="data"
					varStatus="lineInfo">
					<tr>
						<td class="t${lineInfo.count % 2}">
							<input type="checkbox" name="functionIds" value="${data.functionId}" />&nbsp;
						</td>
						<td class="t${lineInfo.count % 2}">
							${lineInfo.count}&nbsp;
						</td>
						<td class="t${lineInfo.count % 2}">
							<c:out value="${data.functionName}" />&nbsp;
						</td>
						<td class="t${lineInfo.count % 2}">
							<c:out value="${data.functionDesc}" />&nbsp;
						</td>
						<td class="t${lineInfo.count % 2}">
							<c:if test="${pageResult.currentPage > 1 || lineInfo.count > 1}">
								<img
									src="/admin/include/images/up.gif"
									style="cursor: pointer" title="向上排序"
									onclick="upFunction('${data.functionId}')" />
							</c:if>
							<c:if
								test="${pageResult.currentPage == 1 && lineInfo.count == 1}">
								<img
									src="/admin/include/images/up_off.gif" />
							</c:if>
							&nbsp;&nbsp;
							<c:if
								test="${pageResult.currentPage < pageResult.totalPages || (pageResult.firstRow + lineInfo.count - 1) < pageResult.totalRows}">
								<img
									src="/admin/include/images/down.gif"
									style="cursor: pointer" title="向下排序"
									onclick="downFunction('${data.functionId}')" />
							</c:if>
							<c:if
								test="${pageResult.currentPage == pageResult.totalPages && (pageResult.firstRow + lineInfo.count - 1) == pageResult.totalRows}">
								<img
									src="/admin/include/images/down_off.gif" />
							</c:if>
							&nbsp;
						</td>
					</tr>
				</c:forEach>
				<tr>
					<td class="page" colspan="5">
						<jsp:include page="/admin/include/page.jsp" />
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>

